package com.fowo.api.sys.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fowo.api.sys.entity.SysParam;
import com.fowo.api.sys.entity.SysUser;
import com.fowo.api.sys.model.SysParamEditModel;
import com.fowo.api.sys.model.SysParamSearch;

import java.util.List;

/**
 * 系统参数服务
 */
public interface SysParamService {

    Page<SysParam> searchPage(SysParamSearch search);
    List<SysParam> search(SysParamSearch search);
    SysParam getById(Long id);
    boolean create(SysParamEditModel model);
    boolean update(SysParamEditModel model);
    boolean delete(Long id);

    String getValueByName(String paramName, String defaultValue);
    int getIntegerByName(String paramName, int defaultValue);
    boolean getSwitchByName(String paramName, boolean defaultSwitch);
    SysUser getUserByName(String paramName, SysUser defaultUser);
    List<SysUser> getUsersByName(String paramName, List<SysUser> defaultUsers);
    <T> T getObjectByName(String paramName, Class<T> cls);
    boolean setObjectByName(String paramName, Object object) throws Exception;
}
